<?php $this->_extends('../_layouts/default_layout'); ?>
<?php $this->_block('contents'); ?>
<script type="text/javascript">
$(function(){
	$(".detail").colorbox({width:"60%", height:"90%", iframe:true});
	$(".upload").colorbox({width:"30%", height:"70%", iframe:true});
	$("#dialog").dialog({autoOpen:false,modal:true});
	$(".copy").click(function(){
		var copy_id = $(this).parent().prev().prev().prev().prev().prev().text();
		$("#copy_id").val(copy_id);
		$("#dialog").dialog("open");
	});
});
</script>
<table class="list_table" width="100%">
<tr>
	<th>ID</th>
	<th>基板名称</th>
	<th>基板类型</th>
	<th>path</th>
	<th>创建时间</th>
	<th>操作</th>
</tr>
<?foreach ($base as $b):?>
<tr>
	<td><?=$b['id']?></td>
	<td><a href="<?=url('Online::EbayTemplate/BaseDetail', array('id' => $b['id']))?>"  class="detail"><?=$b['name']?></a></td>
	<td><?=Helper_BSS_Normal::getIniOne('ebay_template_base_type', 'value', $b['type'], 'name')?></td>
	<td><?=$b['path']?></td>
	<td><?=$b['create_time']?></td>
	<td>
		<a>预览</a>
		<a href="<?=url('Online::EbayTemplate/BaseEdit', array('id' => $b['id']))?>">编辑</a>
		<a href="<?=url('Online::EbayTemplate/catalogue', array('id' => $b['id']))?>"  class="upload">上传</a>
		<a class="copy">复制</a>
<!--	<a href="<?=url('Online::EbayTemplate/BaseDelete', array('id' => $b['id']))?>" onclick="if (! confirm('确定删除?')) return false;" >删除</a>-->
	</td>
</tr>
<?endforeach;?>
</table>
<div id="dialog" title="复制基板">
<form method="post" action="<?=url('Online::EbayTemplate/BaseCopy')?>">
<table class="form_table">
<tr>
	<th>所属店铺</th>
	<td>
		<select name="type" dataType="Require" msg="请选择基板类型" >
			<?foreach (Q::ini('custom_flag/ebay_template_base_type') as $eb):?>
			<option value="<?=$eb['value']?>"><?=$eb['name']?></option>
			<?endforeach;?>
		</select>
	</td>
</tr>
<tr>
	<th>新基板名称</th>
	<td><input type="text" name="template_base_name" /></td>
</tr>
<tr>
	<th><input type="hidden" name="copy_id" id="copy_id" /></th>
	<td><input type="submit" value="确认复制" class="button" /></td>
</tr>
</table>
</form>
</div>
<?=$page;?>
<?php $this->_endblock();?>